﻿using System.Collections.Generic;
using Dapper.Contrib.Extensions;

namespace pinduoduo.Model
{
    [Table("pdd_token")]
    public class PddToken
    {
        [Key]
        public int id { get; set; }

        public string pdd_user_id { get; set; }

        public string PDDAccessToken { get; set; }

        public string cookies { get; set; }

        public string last_order_sn { get; set; }

        public string status { get; set; }

        public int account_type { get; set; } = 0;

        [Write(false)]
        public bool IsCheck { get; set; }
        //public string expireTime { get; set; }

        public override bool Equals(object obj)
        {
            return obj is PddToken token &&
                   pdd_user_id == token.pdd_user_id;
        }

        public override int GetHashCode()
        {
            return -81579791 + EqualityComparer<string>.Default.GetHashCode(pdd_user_id);
        }
    }
}
